package kr.ac.jejuuniv.helloworld;

public class Person {

	private String name;
	private int age;

	public Person(String name, int age) {
		this.name = name;
		this.age = age;
	}


	public String introduce(Person person) {
		String honor = "제 이름은 " + name + "입니다";
		String introduce = "내 이름은 " + name + "야";
		return sayForHonor(person, honor, introduce);
	}



	private int getAge() {
		return age;
	}

	public String hello(Person person) {
		String honor = "안녕하세요 " + person.getName() + " 저 " + name + "에요";
		String hello = "안녕 " + person.getName() + " 나 " + this.name + "야";
		return sayForHonor(person, honor, hello);
	}

	private String sayForHonor(Person person, String honor, String introduce) {
		String resultIntroduce;
		if(age >= person.getAge())
			resultIntroduce = introduce;
		else 
			resultIntroduce = honor;
		return resultIntroduce;
	}
	public String getName() {
		return name;
	}


}
